﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>ORDGetProfileListByAlignmentName</Title>
      <Author>innovoCAD</Author>
      <Description>Code snippet for getting Profile string name list by Alignment Name.</Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>ORDGetProfileListByAlignmentName</Shortcut>
    </Header>
    <Snippet>
      <References>
        <Reference>
          <Assembly>Bentley.CifNET.GeometryModel.SDK.4.0</Assembly>
        </Reference>
      </References>
      <Imports>
	  <Import>
          <Namespace>System.Collections.Generic</Namespace>
        </Import>
        <Import>
          <Namespace>SDK = Bentley.CifNET.GeometryModel.SDK</Namespace>
        </Import>
      </Imports>	
      <Code Language="csharp" Delimiter="$"><![CDATA[/// <summary>
        /// Get Profile string name list by alignment name.
        /// </summary>
        /// <param name="alignmentName"></param>
        /// <returns></returns>
        private List<string> GetProfilesByAlignmentName(string alignmentName)
        {
            List<string> profileNames = new List<string>();
            SDK.Alignment alignment = SDKCon.GetActive().GetAlignmentByName(alignmentName);
            if (0 == alignment.Profiles.Count())
                profileNames.Add("None");
            else
                foreach (SDK.Profile profile in alignment.Profiles)
                {
                    profileNames.Add(profile.Name);
                }

            return profileNames;
        }]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>